package com.yonyou.cyxdms.sysAuth.service.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.yonyou.cyxdms.framework.bean.entity.base.DMSBasePO;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;

import java.io.Serializable;
import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;
import com.yonyou.cyx.framework.bean.dto.base.BaseDTO;

/**
 * <p>
 * 系统订单号生成表
 * </p>
 *
 * @author quankk
 * @since 2019-07-05
 */
@TableName("tc_system_order_no")
public class SystemOrderNoPO extends DMSBasePO<SystemOrderNoPO> {

    private static final long serialVersionUID = 1L;

    /**
     * 系统订单号ID
     */
        @TableId(value = "SYSTEM_ORDER_NO_ID", type = IdType.AUTO)
        private Integer systemOrderNoId;
    /**
     * 经销商代码
     */
    @TableField("DEALER_CODE")
    private String dealerCode;
    /**
     * 订单号前缀
     */
    @TableField("ORDER_PREFIX")
    private String orderPrefix;
    /**
     * 年月
     */
    @TableField("YYYY_MM")
    private String yyyyMm;
    /**
     * 序列号
     */
    @TableField("ORDER_SEQUENCE")
    private Integer orderSequence;
    @TableField("IS_DELETED")
    @Version
    @TableLogic
    private Boolean isDeleted;

    public SystemOrderNoPO() {
        super();
    }


    public Integer getSystemOrderNoId() {
        return systemOrderNoId;
    }

    public void setSystemOrderNoId(Integer systemOrderNoId) {
        this.systemOrderNoId = systemOrderNoId;
    }

    public String getDealerCode() {
        return dealerCode;
    }

    public void setDealerCode(String dealerCode) {
        this.dealerCode = dealerCode;
    }

    public String getOrderPrefix() {
        return orderPrefix;
    }

    public void setOrderPrefix(String orderPrefix) {
        this.orderPrefix = orderPrefix;
    }

    public String getYyyyMm() {
        return yyyyMm;
    }

    public void setYyyyMm(String yyyyMm) {
        this.yyyyMm = yyyyMm;
    }

    public Integer getOrderSequence() {
        return orderSequence;
    }

    public void setOrderSequence(Integer orderSequence) {
        this.orderSequence = orderSequence;
    }

    public Boolean getDeleted() {
        return isDeleted;
    }

    public void setDeleted(Boolean isDeleted) {
        this.isDeleted = isDeleted;
    }

    @Override
    protected Serializable pkVal() {
        return this.systemOrderNoId;
    }

    @Override
    public String toString() {
        return "SystemOrderNoPO{" +
        "systemOrderNoId=" + systemOrderNoId +
        ", dealerCode=" + dealerCode +
        ", orderPrefix=" + orderPrefix +
        ", yyyyMm=" + yyyyMm +
        ", orderSequence=" + orderSequence +
        ", isDeleted=" + isDeleted +
        "}";
    }


    /**
     * 将PO 信息转化为DTO
     *
     * @param dto 需要进行转换的dto
     * @author quankk
     * @since 2018/7/22 0022
     */
    protected <T extends BaseDTO> void transDtoToPo(T dto) {
        BeanMapperUtil.copyProperties(this, dto, "systemOrderNoId");
    }


}
